% Source
[File, Directory ] = uigetfile({'*.mat','MATLAB (*.mat)' },'Select a file','');
if ~ischar(File)
    return
end
Target = fullfile(Directory,File);

% Allan variance setting object
A = AVAR_GUI();

% Source
set(A,'Source',Target);

% Period and unit
set(A,'Period',1,'Unit','s');

% Overlapping mode
set(A,'TimeDefinition','Sampling','TimeValue',100);
set(A,'Overlapping',true);
set(A,'Mode','ADEV');

% Noise template
set(A,'Template',[-1,-0.5,0,+0.5,+1]);

% Allan variance calculation
A.start();

% Allan variance data structure
ADEV_struct = get(A,'ADEV');

% Saving
ADEV_struct.source = get(A,'Source');
save('Allan_variance','ADEV_struct');